﻿// Copyright (c)  MOKEYISH. All rights reserved.
// Licensed under the MIT License, See License.txt in the project root for license information.

namespace NSQL.Expressions.Functions
{
    public class PadFunction : BaseExpression, IPadFunction
    {
        public IStringExpression Text { get; set; }
        public IConstantIntegerExpression Length { get; set; }
        public IConstantStringExpression PaddingText { get; set; }
        public PaddingType Type { get; set; }

        public PadFunction(IValueExpression text, PaddingType type, IConstantIntegerExpression length, IConstantStringExpression paddingText =null)
        {
            Text = (IStringExpression) text;
            Type = type;
            Length = length;
            PaddingText = paddingText;
        }

        public override T Accept<T>(IExpressionVisitor<T> visitor) => visitor.Visit(this);
    }
}